* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

header {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header p {
    margin-top: 0.5rem;
    opacity: 0.9;
}

.upload-container {
    max-width: 900px;
    margin: 0 auto;
}

.drop-zone {
    background-color: white;
    border: 2px dashed #4CAF50;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone.dragover {
    background-color: #e8f5e9;
    border-color: #2e7d32;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.upload-btn {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #45a049;
}

.file-info {
    color: #666;
    font-size: 0.9rem;
}

.preview-container {
    margin-top: 2rem;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-container.hidden {
    display: none;
}

.preview-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.preview-original, .preview-result {
    text-align: center;
}

.preview-original img, .preview-result img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 5px;
    margin-top: 10px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.primary-btn, .secondary-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.primary-btn {
    background-color: #4CAF50;
    color: white;
}

.primary-btn:hover {
    background-color: #45a049;
}

.secondary-btn {
    background-color: #f5f5f5;
    color: #333;
}

.secondary-btn:hover {
    background-color: #e0e0e0;
}

.secondary-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-card h3 {
    margin: 10px 0;
    color: #333;
}

.tool-card p {
    color: #666;
    font-size: 0.9em;
}

.tool-card .coming-soon {
    background: #f0f0f0;
    color: #666;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    display: inline-block;
    margin-top: 10px;
}

.tool-card.active {
    border: 2px solid #4CAF50;
}

.back-link {
    display: inline-block;
    margin-top: 10px;
    color: #4CAF50;
    text-decoration: none;
    font-size: 0.9em;
}

.back-link:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* 响应式布局优化 */
@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
        margin: 10px 0;
    }

    header p {
        font-size: 0.9em;
        margin-bottom: 15px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    .tool-card {
        padding: 15px;
    }

    .tool-card h3 {
        font-size: 1.2em;
    }

    .tool-card p {
        font-size: 0.85em;
    }

    /* 图片去背景工具的移动端优化 */
    .upload-container {
        padding: 10px;
    }

    .drop-zone {
        min-height: 200px;
        margin: 10px 0;
    }

    .preview-wrapper {
        flex-direction: column;
    }

    .preview-original,
    .preview-result {
        width: 100%;
        margin: 10px 0;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons button {
        width: 100%;
        margin: 5px 0;
    }

    .upload-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* 更小屏幕的额外优化 */
@media screen and (max-width: 480px) {
    header h1 {
        font-size: 1.3em;
    }

    .tool-card {
        padding: 12px;
    }

    .tool-card h3 {
        font-size: 1.1em;
    }

    .drop-zone {
        min-height: 180px;
    }
}
